package cn.iocoder.yudao.module.product.dal.mysql.report;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.product.controller.admin.report.vo.ReportDownloadExportReqVO;
import cn.iocoder.yudao.module.product.controller.admin.report.vo.ReportDownloadPageReqVO;
import cn.iocoder.yudao.module.product.dal.dataobject.report.ReportDownloadDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 报告下载 Mapper
 *
 * @author wcl
 */
@Mapper
public interface ReportDownloadMapper extends BaseMapperX<ReportDownloadDO> {

    default PageResult<ReportDownloadDO> selectPage(ReportDownloadPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ReportDownloadDO>()
                .eqIfPresent(ReportDownloadDO::getReportId, reqVO.getReportId())
                .eqIfPresent(ReportDownloadDO::getType, reqVO.getType())
                .betweenIfPresent(ReportDownloadDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ReportDownloadDO::getId));
    }

}
